package com.zub.config;

import java.util.List;
import java.util.Map;

/**
 * An adapter class to get JMX working.
 * <p/>
 * The name is a bit strange but it's required to be complaint with the MBean standards
 *
 * @author miken
 * @version 1.0 Jul 21, 2009
 */
public class ConfigerAdapter implements ConfigerAdapterMBean {
    public ConfigerAdapter() {
    }

    @Override
    public List list() {
        return Configer.getInstance().list();
    }

    @Override
    public Map getAll() {
        return Configer.getInstance().getAll();
    }

    @Override
    public void setConfig(String property, String newValue) throws RequiredConfigNotFoundException {
        Configer.getInstance().setConfig(property, newValue);
    }

    @Override
    public String getConfig(String propertyName) {
        return Configer.getInstance().getConfig(propertyName);
    }

    @Override
    public String getCurrentEnvironment() {
        return Configer.getInstance().getCurrentEnvironment();
    }
}
